package com.study.english.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.english.pojo.vo.PlStudyPlanVideoVo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.study.english.domain.PlStudyPlanVideo;
import com.study.english.service.IPlStudyPlanVideoService;
import com.study.english.mapper.PlStudyPlanVideoMapper;
import org.springframework.stereotype.Service;

/**
 * @author wf
 * @description 针对表【pl_study_plan_video(学习计划内容)】的数据库操作Service实现
 * @createDate 2024-06-27 15:28:53
 */
@Service
public class PlStudyPlanVideoServiceImpl extends ServiceImpl<PlStudyPlanVideoMapper, PlStudyPlanVideo>
        implements IPlStudyPlanVideoService {

    @Autowired
    private IPlStudyPlanVideoService plStudyPlanVideoService;


    @Override
    public void addPlStudyPlanVideo(PlStudyPlanVideoVo plStudyPlanVideoVo) {
        PlStudyPlanVideo plStudyPlanVideo = new PlStudyPlanVideo();
        BeanUtils.copyProperties(plStudyPlanVideoVo, plStudyPlanVideo);
        plStudyPlanVideo.setIsDelete(0);
        plStudyPlanVideo.setCreateTime(new Date());
        plStudyPlanVideoService.save(plStudyPlanVideo);
    }

    @Override
    public IPage<PlStudyPlanVideoVo> getPlStudyPlanVideoPageList(IPage<PlStudyPlanVideoVo> page, PlStudyPlanVideoVo plStudyPlanVideoVo) {
        return this.baseMapper.getPlStudyPlanVideoPageList(page, plStudyPlanVideoVo);
    }


    @Override
    public List<PlStudyPlanVideoVo> getPlStudyPlanVideoList(PlStudyPlanVideoVo plStudyPlanVideoVo) {
        return this.baseMapper.getPlStudyPlanVideoList(plStudyPlanVideoVo);

    }

    @Override
    public PlStudyPlanVideoVo getPlStudyPlanVideoById(Long id) {
        return this.baseMapper.getDetailById(id);
    }


    @Override
    public void delPlStudyPlanVideo(Long id) {
        plStudyPlanVideoService.removeById(id);
    }


    @Override
    public void updatePlStudyPlanVideo(PlStudyPlanVideoVo plStudyPlanVideoVo) {
        PlStudyPlanVideo plStudyPlanVideo = new PlStudyPlanVideo();
        BeanUtils.copyProperties(plStudyPlanVideoVo, plStudyPlanVideo);
        plStudyPlanVideoService.updateById(plStudyPlanVideo);
    }
}




